<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <div>hello</div>

  <p id="ss" class="a">hahahaha</p>

  <ul>
    <li>aaaa</li>
    <li>aaaa</li>
    <li>aaaa</li>
    <li>aaaa</li>
  </ul>

  <ul>
    <li>111</li>
    <li class="a">222</li>
    <li class="a">333</li>
    <li class="a">333</li>
    <li class="a">333</li>
    <li class="a">333</li>
    <li class="a">333</li>
  </ul>

  <input type="text" name="username">
  <input type="text" name="phone">

  <script src="./jquery-3.6.0.js"></script>
  <script>
    // 选择器：选择页面的元素

    // console.log($('div'))

    // console.log($('#ss'));

    // console.log($('ul > li'));

    // console.log($('.a'));

    // console.log($('input[属性=值]'));
    // console.log($('input[name=username]'));

    // $('li:odd').css('样式名称', '值');
    $('li:odd').css('background-color', '#ccc');
    $('li:even').css('background-color', 'pink');

    // console.log($('li:first'));  // 找所有li中的第一个
    console.log($('li:first-child'));  // 找每个ul中的第一个li
  </script>
</body>

</html>